package org.springboot.demo.service;

import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommonService<E> {
    //分页
    List<E> getAll(@Param("offset")int offset, @Param("limit")int limit);
    //把参数封装成对象传入 查对象
    E getByEntity(String name);
    //分页
    E getByEntity(E e,@Param("offset")int offset,@Param("limit")int limit);
    //根据id查所有
    List<E> getByid(@Param("id")int id);
    List<E> getByid(@Param("id")int id,@Param("offset")int offset,@Param("limit")int limit);
    //更新
    int Update(E e);

    //新增
    int Insert(E e);


    //删除
    int Delete(@Param("id")int id);
    int Delete(E e);

}
